package com.github.jcooky.structure;

public interface BinaryTree extends Tree {
	public class HasTwoChildrenException extends Exception {
	}
	public class IsNotExternalException extends Exception {
	}
	
	public Node left(Node v);
	public Node right(Node v);
	public boolean hasLeft(Node v);
	public boolean hasRight(Node v);
	
	public int getDepth(Node v);
	public int getHeight(Node v);
	public Node addRoot(Object e);
	public Node insertLeft(Node v, Object e);
	public Node insertRight(Node v, Object e);
	public Object remove(Node v) throws HasTwoChildrenException;
	public Object attach(Node v, Tree t1, Tree t2) throws IsNotExternalException;
}
